/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bash.jcouture.util.swing;

import java.text.NumberFormat;
import java.util.Locale;
import java.util.StringTokenizer;

/**
 *
 * @author bashizip
 */
public class MyStringUtils {

    public static String returnJustID(String in, String token) {
        StringTokenizer tok = new StringTokenizer(in, token);
        return tok.nextToken();
    }

    public static String toCurrencyFormat(double d, Locale l) {

        Double currency = new Double(d);
        NumberFormat currencyFormatter;
        String currencyOut;

        currencyFormatter = NumberFormat.getCurrencyInstance(l);
        currencyOut = currencyFormatter.format(currency);
        System.out.println(currencyOut + " "
                + l.toString());

        return currencyOut;
    }

    public static Object toCustomCurrencyFormat(double totalFC) {
       
        NumberFormat numberFormatter;
        String amountOut;

        numberFormatter = NumberFormat.getNumberInstance(Locale.FRANCE);
        amountOut = numberFormatter.format(totalFC);
        System.out.println(amountOut + " "
                + Locale.FRANCE.toString());

        return amountOut;
    }
}
